id: task-201 title: Add configurable git hooks bypass option status: Done assignee:
- '@claude' created_date: '2025-07-23' updated_date: '2025-07-26' labels:
- enhancement
- git dependencies: []
Description
Allow users to optionally bypass git hooks when committing backlog changes. This addresses scenarios where pre-commit hooks (like conventional commits or linters) interfere with backlog.md's automated commits. The option should be configurable through config.yml and prompted during init wizard when remote operations are enabled.
Based on contribution from PR #214: https://github.com/MrLesk/Backlog.md/pull/214
Implementation Plan
-
Add bypassGitHooks to configuration schema
- Update
src/types/index.tsto addbypassGitHooks?: booleanto BacklogConfig type - Update
src/config.tsto add validation for the new option - Set default value to
falsein config defaults
- Update
-
Update init wizard
- Modify
src/init/wizard.tsto prompt for git hooks bypass whenremoteOperationsis enabled - Add the prompt after remote operations is confirmed
- Save the preference to config.yml
- Modify
-
Modify git operations
- Update
src/git.tsto check forbypassGitHooksconfig - Add
--no-verifyflag to all git commit commands when enabled - Ensure this applies to all commit operations (task updates, board commits, etc.)
- Update
-
Add config set support
- Update
src/commands/config.tsto handle the newbypassGitHooksoption - Add validation to ensure boolean values only
- Update
-
Update documentation
- Add bypassGitHooks option to README configuration section
- Explain when and why to use this option
-
Testing
- Write tests for config validation
- Test init wizard flow with and without remote operations
- Test git commit operations with bypass enabled/disabled
Implementation Notes
Successfully implemented the bypassGitHooks configuration option:
- Configuration Schema: Added
bypassGitHooks?: booleanto the BacklogConfig interface insrc/types/index.ts - Default Config: Added default value of
falseinsrc/core/config-migration.ts - Config Parser: Updated
src/file-system/operations.tsto parsebypass_git_hooksfrom config.yml and serialize it back - Init Wizard: Added conditional prompt in
src/cli.tsthat only shows whenremoteOperationsis enabled - Git Operations: Modified
commitTaskChange,commitChanges, andcommitStagedChangesmethods insrc/git/operations.tsto add--no-verifyflag whenbypassGitHooksis true - Config Commands: Added support for getting and setting
bypassGitHooksvia the config command - Documentation: Updated README.md with the new configuration option in both the configuration table and CLI reference
The implementation follows the existing patterns in the codebase and maintains backward compatibility. The feature is opt-in with a default value of false.
Acceptance Criteria
- [x] Add bypassGitHooks config option (default: false)
- [x] Init wizard prompts for git hooks bypass when remoteOperations is true
- [x] When enabled, all git commit operations use --no-verify flag
- [x] Config option is documented in README
- [x] Only prompted when user enables remote operations during init
- [x] Existing projects can update this setting via config set command